﻿<%@ Control Language="C#" Inherits="Yuanlin.Business.CompanyFriendEditControl, Yuanlin.Business" AutoEventWireup="true" %>
<script type="text/javascript">
<!--
    function CheckValue()
    {
        var select = document.getElementById('<%= categoryDropDownList.ClientID %>');
        var hasSelected = false;
        for(var i = 0; i < select.length; i++)
        {   
            if(select[i].selected)
            {
                hasSelected = true;
                break;
            }   
        }   
        if(hasSelected == false)
        {   
            alert('请选择类别！');
            select.focus();
            return false;
        }
        
        var friendGreenNumber = document.getElementById('<%= friendGreenNumberValuedTextBox.ClientID %>');
        if(friendGreenNumber.value.Trim().length==0)
        {
            alert('请填写绿商号！');
            friendGreenNumber.focus();
            return false;
        }
        else if (!isDigit(friendGreenNumber.value.Trim())) {
            alert("绿商号必须是11位或12位数字!");
            friendGreenNumber.focus();
            return false;
        } else if (!(friendGreenNumber.value.Trim().length == 11 || friendGreenNumber.value.Trim().length == 12)) {
            alert("绿商号必须是11位或12位数字!");
            friendGreenNumber.focus();
            return false;
        }
        
        return true;
    }
//-->
</script>
<div class="AdminArea">
    <fieldset>
        <legend><nwap:ResourceLiteral runat="server" ResourceName="System_Applications_Yuanlin_EditCompanyFriend" ResourceFile="ControlPanelResources.xml"></nwap:ResourceLiteral></legend>
		
		<div class="FormRow">
            <div class="LargerFieldNameRequireCharacter">
                <nwap:ResourceLabel runat="Server" CssClass="RedColor" ResourceFile="ControlPanelResources.xml" ResourceName="RequireCharacter" />
                <nwap:ResourceLabel runat="Server" ControlToLabel="categoryDropDownList" ResourceFile="ControlPanelResources.xml" ResourceName="System_Applications_Yuanlin_CompanyFriend_Category" />
            </div>
            <nwap:ValuedDropDownList Runat="server" CssClass="InputField SmallWidth" id="categoryDropDownList" />&nbsp;&nbsp;
        </div>
        
        <div class="FormRow">
            <div class="LargerFieldNameRequireCharacter">
                <nwap:ResourceLabel runat="Server" CssClass="RedColor" ResourceFile="ControlPanelResources.xml" ResourceName="RequireCharacter" />
                <nwap:ResourceLabel runat="Server" ControlToLabel="friendGreenNumberValuedTextBox" ResourceFile="ControlPanelResources.xml" ResourceName="System_Applications_Yuanlin_CompanyFriend_FriendGreenNumber" />
            </div>
            <nwap:ValuedTextBox Runat="server" CssClass="InputField MiddleWidth" id="friendGreenNumberValuedTextBox" />
        </div>

        <div class="FormRow SubmitButtonRow">
            <nwap:Resourcebutton id="SaveButton" ResourceName="Save" CssClass="Button" Runat="server" OnClientClick="return CheckValue()"></nwap:Resourcebutton>&nbsp;&nbsp;&nbsp;&nbsp;
            <nwap:Resourcebutton id="BackButton" ResourceName="Back" CssClass="Button" Runat="server"></nwap:Resourcebutton>
        </div>	
    </fieldset>
</div> 